.class public Lnet/oauth/OAuthMessage;
.super Ljava/lang/Object;
.source "OAuthMessage.java"


# static fields
.field private static final AUTHORIZATION:Ljava/util/regex/Pattern; = null

.field public static final AUTH_SCHEME:Ljava/lang/String; = "OAuth"

.field public static final DELETE:Ljava/lang/String; = "DELETE"

.field public static final GET:Ljava/lang/String; = "GET"

.field private static final NVP:Ljava/util/regex/Pattern; = null

.field public static final POST:Ljava/lang/String; = "POST"

.field public static final PUT:Ljava/lang/String; = "PUT"


# instance fields
.field public URL:Ljava/lang/String;

.field private final bodyAsStream:Ljava/io/InputStream;

.field private final headers:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List",
            "<",
            "Ljava/util/Map$Entry",
            "<",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            ">;>;"
        }
    .end annotation
.end field

.field public method:Ljava/lang/String;

.field private parameterMap:Ljava/util/Map;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Map",
            "<",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            ">;"
        }
    .end annotation
.end field

.field private final parameters:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List",
            "<",
            "Ljava/util/Map$Entry",
            "<",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            ">;>;"
        }
    .end annotation
.end field

.field private parametersAreComplete:Z


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .prologue
    .line 378
    const-string v0, "\\s*(\\w*)\\s+(.*)"

    invoke-static {v0}, Ljava/util/regex/Pattern;->compile(Ljava/lang/String;)Ljava/util/regex/Pattern;

    move-result-object v0

    sput-object v0, Lnet/oauth/OAuthMessage;->AUTHORIZATION:Ljava/util/regex/Pattern;

    .line 379
    const-string v0, "(\\S*)\\s*\\=\\s*\"([^\"]*)\""

    invoke-static {v0}, Ljava/util/regex/Pattern;->compile(Ljava/lang/String;)Ljava/util/regex/Pattern;

    move-result-object v0

    sput-object v0, Lnet/oauth/OAuthMessage;->NVP:Ljava/util/regex/Pattern;

    return-void
.end method

.method public constructor <init>(Ljava/lang/String;Ljava/lang/String;Ljava/util/Collection;)V
    .locals 1
    .parameter "method"
    .parameter "URL"
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            "Ljava/util/Collection",
            "<+",
            "Ljava/util/Map$Entry;",
            ">;)V"
        }
    .end annotation

    .prologue
    .line 49
    .local p3, parameters:Ljava/util/Collection;,"Ljava/util/Collection<+Ljava/util/Map$Entry;>;"
    const/4 v0, 0x0

    invoke-direct {p0, p1, p2, p3, v0}, Lnet/oauth/OAuthMessage;-><init>(Ljava/lang/String;Ljava/lang/String;Ljava/util/Collection;Ljava/io/InputStream;)V

    .line 50
    return-void
.end method

.method public constructor <init>(Ljava/lang/String;Ljava/lang/String;Ljava/util/Collection;Ljava/io/InputStream;)V
    .locals 6
    .parameter "method"
    .parameter "URL"
    .parameter
    .parameter "bodyAsStream"
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            "Ljava/util/Collection",
            "<+",
            "Ljava/util/Map$Entry;",
            ">;",
            "Ljava/io/InputStream;",
            ")V"
        }
    .end annotation

    .prologue
    .line 53
    .local p3, parameters:Ljava/util/Collection;,"Ljava/util/Collection<+Ljava/util/Map$Entry;>;"
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 73
    const/4 v2, 0x0

    iput-boolean v2, p0, Lnet/oauth/OAuthMessage;->parametersAreComplete:Z

    .line 74
    new-instance v2, Ljava/util/ArrayList;

    invoke-direct {v2}, Ljava/util/ArrayList;-><init>()V

    iput-object v2, p0, Lnet/oauth/OAuthMessage;->headers:Ljava/util/List;

    .line 54
    iput-object p1, p0, Lnet/oauth/OAuthMessage;->method:Ljava/lang/String;

    .line 55
    iput-object p2, p0, Lnet/oauth/OAuthMessage;->URL:Ljava/lang/String;

    .line 56
    iput-object p4, p0, Lnet/oauth/OAuthMessage;->bodyAsStream:Ljava/io/InputStream;

    .line 57
    if-nez p3, :cond_1

    .line 58
    new-instance v2, Ljava/util/ArrayList;

    invoke-direct {v2}, Ljava/util/ArrayList;-><init>()V

    iput-object v2, p0, Lnet/oauth/OAuthMessage;->parameters:Ljava/util/List;

    .line 66
    :cond_0
    return-void

    .line 60
    :cond_1
    new-instance v2, Ljava/util/ArrayList;

    invoke-interface {p3}, Ljava/util/Collection;->size()I

    move-result v3

    invoke-direct {v2, v3}, Ljava/util/ArrayList;-><init>(I)V

    iput-object v2, p0, Lnet/oauth/OAuthMessage;->parameters:Ljava/util/List;

    .line 61
    invoke-interface {p3}, Ljava/util/Collection;->iterator()Ljava/util/Iterator;

    move-result-object v0

    .local v0, i$:Ljava/util/Iterator;
    :goto_0
    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v2

    if-eqz v2, :cond_0

    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Ljava/util/Map$Entry;

    .line 62
    .local v1, p:Ljava/util/Map$Entry;
    iget-object v2, p0, Lnet/oauth/OAuthMessage;->parameters:Ljava/util/List;

    new-instance v3, Lnet/oauth/OAuth$Parameter;

    invoke-interface {v1}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object;

    move-result-object v4

    invoke-static {v4}, Lnet/oauth/OAuthMessage;->toString(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v4

    invoke-interface {v1}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;

    move-result-object v5

    invoke-static {v5}, Lnet/oauth/OAuthMessage;->toString(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v5

    invoke-direct {v3, v4, v5}, Lnet/oauth/OAuth$Parameter;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    invoke-interface {v2, v3}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    goto :goto_0
.end method

.method private beforeGetParameter()V
    .locals 1
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .prologue
    .line 83
    iget-boolean v0, p0, Lnet/oauth/OAuthMessage;->parametersAreComplete:Z

    if-nez v0, :cond_0

    .line 84
    invoke-virtual {p0}, Lnet/oauth/OAuthMessage;->completeParameters()V

    .line 85
    const/4 v0, 0x1

    iput-boolean v0, p0, Lnet/oauth/OAuthMessage;->parametersAreComplete:Z

    .line 87
    :cond_0
    return-void
.end method

.method public static decodeAuthorization(Ljava/lang/String;)Ljava/util/List;
    .locals 12
    .parameter "authorization"
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/String;",
            ")",
            "Ljava/util/List",
            "<",
            "Lnet/oauth/OAuth$Parameter;",
            ">;"
        }
    .end annotation

    .prologue
    const/4 v11, 0x2

    const/4 v10, 0x1

    .line 352
    new-instance v2, Ljava/util/ArrayList;

    invoke-direct {v2}, Ljava/util/ArrayList;-><init>()V

    .line 353
    .local v2, into:Ljava/util/List;,"Ljava/util/List<Lnet/oauth/OAuth$Parameter;>;"
    if-eqz p0, :cond_1

    .line 354
    sget-object v8, Lnet/oauth/OAuthMessage;->AUTHORIZATION:Ljava/util/regex/Pattern;

    invoke-virtual {v8, p0}, Ljava/util/regex/Pattern;->matcher(Ljava/lang/CharSequence;)Ljava/util/regex/Matcher;

    move-result-object v4

    .line 355
    .local v4, m:Ljava/util/regex/Matcher;
    invoke-virtual {v4}, Ljava/util/regex/Matcher;->matches()Z

    move-result v8

    if-eqz v8, :cond_1

    .line 356
    const-string v8, "OAuth"

    invoke-virtual {v4, v10}, Ljava/util/regex/Matcher;->group(I)Ljava/lang/String;

    move-result-object v9

    invoke-virtual {v8, v9}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v8

    if-eqz v8, :cond_1

    .line 357
    invoke-virtual {v4, v11}, Ljava/util/regex/Matcher;->group(I)Ljava/lang/String;

    move-result-object v8

    const-string v9, "\\s*,\\s*"

    invoke-virtual {v8, v9}, Ljava/lang/String;->split(Ljava/lang/String;)[Ljava/lang/String;

    move-result-object v0

    .local v0, arr$:[Ljava/lang/String;
    array-length v3, v0

    .local v3, len$:I
    const/4 v1, 0x0

    .local v1, i$:I
    :goto_0
    if-ge v1, v3, :cond_1

    aget-object v6, v0, v1

    .line 358
    .local v6, nvp:Ljava/lang/String;
    sget-object v8, Lnet/oauth/OAuthMessage;->NVP:Ljava/util/regex/Pattern;

    invoke-virtual {v8, v6}, Ljava/util/regex/Pattern;->matcher(Ljava/lang/CharSequence;)Ljava/util/regex/Matcher;

    move-result-object v4

    .line 359
    invoke-virtual {v4}, Ljava/util/regex/Matcher;->matches()Z

    move-result v8

    if-eqz v8, :cond_0

    .line 360
    invoke-virtual {v4, v10}, Ljava/util/regex/Matcher;->group(I)Ljava/lang/String;

    move-result-object v8

    invoke-static {v8}, Lnet/oauth/OAuth;->decodePercent(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v5

    .line 361
    .local v5, name:Ljava/lang/String;
    invoke-virtual {v4, v11}, Ljava/util/regex/Matcher;->group(I)Ljava/lang/String;

    move-result-object v8

    invoke-static {v8}, Lnet/oauth/OAuth;->decodePercent(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v7

    .line 362
    .local v7, value:Ljava/lang/String;
    new-instance v8, Lnet/oauth/OAuth$Parameter;

    invoke-direct {v8, v5, v7}, Lnet/oauth/OAuth$Parameter;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    invoke-interface {v2, v8}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 357
    .end local v5           #name:Ljava/lang/String;
    .end local v7           #value:Ljava/lang/String;
    :cond_0
    add-int/lit8 v1, v1, 0x1

    goto :goto_0

    .line 368
    .end local v0           #arr$:[Ljava/lang/String;
    .end local v1           #i$:I
    .end local v3           #len$:I
    .end local v4           #m:Ljava/util/regex/Matcher;
    .end local v6           #nvp:Ljava/lang/String;
    :cond_1
    return-object v2
.end method

.method public static readAll(Ljava/io/InputStream;Ljava/lang/String;)Ljava/lang/String;
    .locals 5
    .parameter "from"
    .parameter "encoding"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .prologue
    .line 330
    if-nez p0, :cond_0

    .line 331
    const/4 v4, 0x0

    .line 342
    :goto_0
    return-object v4

    .line 334
    :cond_0
    :try_start_0
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    .line 335
    .local v0, into:Ljava/lang/StringBuilder;
    new-instance v2, Ljava/io/InputStreamReader;

    invoke-direct {v2, p0, p1}, Ljava/io/InputStreamReader;-><init>(Ljava/io/InputStream;Ljava/lang/String;)V

    .line 336
    .local v2, r:Ljava/io/Reader;
    const/16 v4, 0x200

    new-array v3, v4, [C

    .line 337
    .local v3, s:[C
    :goto_1
    invoke-virtual {v2, v3}, Ljava/io/Reader;->read([C)I

    move-result v1

    .local v1, n:I
    if-lez v1, :cond_1

    .line 338
    const/4 v4, 0x0

    invoke-virtual {v0, v3, v4, v1}, Ljava/lang/StringBuilder;->append([CII)Ljava/lang/StringBuilder;
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    goto :goto_1

    .line 342
    .end local v0           #into:Ljava/lang/StringBuilder;
    .end local v1           #n:I
    .end local v2           #r:Ljava/io/Reader;
    .end local v3           #s:[C
    :catchall_0
    move-exception v4

    invoke-virtual {p0}, Ljava/io/InputStream;->close()V

    throw v4

    .line 340
    .restart local v0       #into:Ljava/lang/StringBuilder;
    .restart local v1       #n:I
    .restart local v2       #r:Ljava/io/Reader;
    .restart local v3       #s:[C
    :cond_1
    :try_start_1
    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    move-result-object v4

    .line 342
    invoke-virtual {p0}, Ljava/io/InputStream;->close()V

    goto :goto_0
.end method

.method private static final toString(Ljava/lang/Object;)Ljava/lang/String;
    .locals 1
    .parameter "from"

    .prologue
    .line 382
    if-nez p0, :cond_0

    const/4 v0, 0x0

    :goto_0
    return-object v0

    :cond_0
    invoke-virtual {p0}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v0

    goto :goto_0
.end method


# virtual methods
.method public addParameter(Ljava/lang/String;Ljava/lang/String;)V
    .locals 1
    .parameter "key"
    .parameter "value"

    .prologue
    .line 102
    new-instance v0, Lnet/oauth/OAuth$Parameter;

    invoke-direct {v0, p1, p2}, Lnet/oauth/OAuth$Parameter;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    invoke-virtual {p0, v0}, Lnet/oauth/OAuthMessage;->addParameter(Ljava/util/Map$Entry;)V

    .line 103
    return-void
.end method

.method public addParameter(Ljava/util/Map$Entry;)V
    .locals 1
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/Map$Entry",
            "<",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            ">;)V"
        }
    .end annotation

    .prologue
    .line 106
    .local p1, parameter:Ljava/util/Map$Entry;,"Ljava/util/Map$Entry<Ljava/lang/String;Ljava/lang/String;>;"
    iget-object v0, p0, Lnet/oauth/OAuthMessage;->parameters:Ljava/util/List;

    invoke-interface {v0, p1}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 107
    const/4 v0, 0x0

    iput-object v0, p0, Lnet/oauth/OAuthMessage;->parameterMap:Ljava/util/Map;

    .line 108
    return-void
.end method

.method public addParameters(Ljava/util/Collection;)V
    .locals 1
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/Collection",
            "<+",
            "Ljava/util/Map$Entry",
            "<",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            ">;>;)V"
        }
    .end annotation

    .prologue
    .line 112
    .local p1, parameters:Ljava/util/Collection;,"Ljava/util/Collection<+Ljava/util/Map$Entry<Ljava/lang/String;Ljava/lang/String;>;>;"
    iget-object v0, p0, Lnet/oauth/OAuthMessage;->parameters:Ljava/util/List;

    invoke-interface {v0, p1}, Ljava/util/List;->addAll(Ljava/util/Collection;)Z

    .line 113
    const/4 v0, 0x0

    iput-object v0, p0, Lnet/oauth/OAuthMessage;->parameterMap:Ljava/util/Map;

    .line 114
    return-void
.end method

.method public addRequiredParameters(Lnet/oauth/OAuthAccessor;)V
    .locals 9
    .parameter "accessor"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lnet/oauth/OAuthException;,
            Ljava/io/IOException;,
            Ljava/net/URISyntaxException;
        }
    .end annotation

    .prologue
    .line 260
    iget-object v3, p0, Lnet/oauth/OAuthMessage;->parameters:Ljava/util/List;

    invoke-static {v3}, Lnet/oauth/OAuth;->newMap(Ljava/lang/Iterable;)Ljava/util/Map;

    move-result-object v1

    .line 261
    .local v1, pMap:Ljava/util/Map;,"Ljava/util/Map<Ljava/lang/String;Ljava/lang/String;>;"
    const-string v3, "oauth_token"

    invoke-interface {v1, v3}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v3

    if-nez v3, :cond_0

    iget-object v3, p1, Lnet/oauth/OAuthAccessor;->accessToken:Ljava/lang/String;

    if-eqz v3, :cond_0

    .line 262
    const-string v3, "oauth_token"

    iget-object v4, p1, Lnet/oauth/OAuthAccessor;->accessToken:Ljava/lang/String;

    invoke-virtual {p0, v3, v4}, Lnet/oauth/OAuthMessage;->addParameter(Ljava/lang/String;Ljava/lang/String;)V

    .line 264
    :cond_0
    iget-object v0, p1, Lnet/oauth/OAuthAccessor;->consumer:Lnet/oauth/OAuthConsumer;

    .line 265
    .local v0, consumer:Lnet/oauth/OAuthConsumer;
    const-string v3, "oauth_consumer_key"

    invoke-interface {v1, v3}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v3

    if-nez v3, :cond_1

    .line 266
    const-string v3, "oauth_consumer_key"

    iget-object v4, v0, Lnet/oauth/OAuthConsumer;->consumerKey:Ljava/lang/String;

    invoke-virtual {p0, v3, v4}, Lnet/oauth/OAuthMessage;->addParameter(Ljava/lang/String;Ljava/lang/String;)V

    .line 268
    :cond_1
    const-string v3, "oauth_signature_method"

    invoke-interface {v1, v3}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/lang/String;

    .line 269
    .local v2, signatureMethod:Ljava/lang/String;
    if-nez v2, :cond_3

    .line 270
    const-string v3, "oauth_signature_method"

    invoke-virtual {v0, v3}, Lnet/oauth/OAuthConsumer;->getProperty(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v2

    .end local v2           #signatureMethod:Ljava/lang/String;
    check-cast v2, Ljava/lang/String;

    .line 271
    .restart local v2       #signatureMethod:Ljava/lang/String;
    if-nez v2, :cond_2

    .line 272
    const-string v2, "HMAC-SHA1"

    .line 274
    :cond_2
    const-string v3, "oauth_signature_method"

    invoke-virtual {p0, v3, v2}, Lnet/oauth/OAuthMessage;->addParameter(Ljava/lang/String;Ljava/lang/String;)V

    .line 276
    :cond_3
    const-string v3, "oauth_timestamp"

    invoke-interface {v1, v3}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v3

    if-nez v3, :cond_4

    .line 277
    const-string v3, "oauth_timestamp"

    new-instance v4, Ljava/lang/StringBuilder;

    invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V

    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v5

    const-wide/16 v7, 0x3e8

    div-long/2addr v5, v7

    invoke-virtual {v4, v5, v6}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    move-result-object v4

    const-string v5, ""

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {p0, v3, v4}, Lnet/oauth/OAuthMessage;->addParameter(Ljava/lang/String;Ljava/lang/String;)V

    .line 279
    :cond_4
    const-string v3, "oauth_nonce"

    invoke-interface {v1, v3}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v3

    if-nez v3, :cond_5

    .line 280
    const-string v3, "oauth_nonce"

    new-instance v4, Ljava/lang/StringBuilder;

    invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V

    invoke-static {}, Ljava/lang/System;->nanoTime()J

    move-result-wide v5

    invoke-virtual {v4, v5, v6}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    move-result-object v4

    const-string v5, ""

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {p0, v3, v4}, Lnet/oauth/OAuthMessage;->addParameter(Ljava/lang/String;Ljava/lang/String;)V

    .line 282
    :cond_5
    const-string v3, "oauth_version"

    invoke-interface {v1, v3}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v3

    if-nez v3, :cond_6

    .line 283
    const-string v3, "oauth_version"

    const-string v4, "1.0"

    invoke-virtual {p0, v3, v4}, Lnet/oauth/OAuthMessage;->addParameter(Ljava/lang/String;Ljava/lang/String;)V

    .line 285
    :cond_6
    invoke-virtual {p0, p1}, Lnet/oauth/OAuthMessage;->sign(Lnet/oauth/OAuthAccessor;)V

    .line 286
    return-void
.end method

.method protected completeParameters()V
    .locals 0
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .prologue
    .line 94
    return-void
.end method

.method protected dump(Ljava/util/Map;)V
    .locals 2
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/Map",
            "<",
            "Ljava/lang/String;",
            "Ljava/lang/Object;",
            ">;)V"
        }
    .end annotation

    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .prologue
    .line 218
    .local p1, into:Ljava/util/Map;,"Ljava/util/Map<Ljava/lang/String;Ljava/lang/Object;>;"
    const-string v0, "URL"

    iget-object v1, p0, Lnet/oauth/OAuthMessage;->URL:Ljava/lang/String;

    invoke-interface {p1, v0, v1}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 219
    iget-boolean v0, p0, Lnet/oauth/OAuthMessage;->parametersAreComplete:Z

    if-eqz v0, :cond_0

    .line 221
    :try_start_0
    invoke-virtual {p0}, Lnet/oauth/OAuthMessage;->getParameterMap()Ljava/util/Map;

    move-result-object v0

    invoke-interface {p1, v0}, Ljava/util/Map;->putAll(Ljava/util/Map;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 225
    :cond_0
    :goto_0
    return-void

    .line 222
    :catch_0
    move-exception v0

    goto :goto_0
.end method

.method public getAuthorizationHeader(Ljava/lang/String;)Ljava/lang/String;
    .locals 7
    .parameter "realm"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .prologue
    const/16 v6, 0x22

    .line 303
    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    .line 304
    .local v1, into:Ljava/lang/StringBuilder;
    if-eqz p1, :cond_0

    .line 305
    const-string v4, " realm=\""

    invoke-virtual {v1, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-static {p1}, Lnet/oauth/OAuth;->percentEncode(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v5

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4, v6}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;

    .line 307
    :cond_0
    invoke-direct {p0}, Lnet/oauth/OAuthMessage;->beforeGetParameter()V

    .line 308
    iget-object v4, p0, Lnet/oauth/OAuthMessage;->parameters:Ljava/util/List;

    if-eqz v4, :cond_3

    .line 309
    iget-object v4, p0, Lnet/oauth/OAuthMessage;->parameters:Ljava/util/List;

    invoke-interface {v4}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v0

    .local v0, i$:Ljava/util/Iterator;
    :cond_1
    :goto_0
    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v4

    if-eqz v4, :cond_3

    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Ljava/util/Map$Entry;

    .line 310
    .local v3, parameter:Ljava/util/Map$Entry;
    invoke-interface {v3}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object;

    move-result-object v4

    invoke-static {v4}, Lnet/oauth/OAuthMessage;->toString(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v2

    .line 311
    .local v2, name:Ljava/lang/String;
    const-string v4, "oauth_"

    invoke-virtual {v2, v4}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v4

    if-eqz v4, :cond_1

    .line 312
    invoke-virtual {v1}, Ljava/lang/StringBuilder;->length()I

    move-result v4

    if-lez v4, :cond_2

    const-string v4, ","

    invoke-virtual {v1, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    .line 313
    :cond_2
    const-string v4, " "

    invoke-virtual {v1, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    .line 314
    invoke-static {v2}, Lnet/oauth/OAuth;->percentEncode(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v1, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    const-string v5, "=\""

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    .line 315
    invoke-interface {v3}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;

    move-result-object v4

    invoke-static {v4}, Lnet/oauth/OAuthMessage;->toString(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v4

    invoke-static {v4}, Lnet/oauth/OAuth;->percentEncode(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v1, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4, v6}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;

    goto :goto_0

    .line 319
    .end local v0           #i$:Ljava/util/Iterator;
    .end local v2           #name:Ljava/lang/String;
    .end local v3           #parameter:Ljava/util/Map$Entry;
    :cond_3
    new-instance v4, Ljava/lang/StringBuilder;

    invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V

    const-string v5, "OAuth"

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v5

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    return-object v4
.end method

.method public getBodyAsStream()Ljava/io/InputStream;
    .locals 1
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .prologue
    .line 207
    iget-object v0, p0, Lnet/oauth/OAuthMessage;->bodyAsStream:Ljava/io/InputStream;

    return-object v0
.end method

.method public getBodyEncoding()Ljava/lang/String;
    .locals 1

    .prologue
    .line 160
    const-string v0, "ISO-8859-1"

    return-object v0
.end method

.method public getBodyType()Ljava/lang/String;
    .locals 1

    .prologue
    .line 150
    const-string v0, "Content-Type"

    invoke-virtual {p0, v0}, Lnet/oauth/OAuthMessage;->getHeader(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public getConsumerKey()Ljava/lang/String;
    .locals 1
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .prologue
    .line 121
    const-string v0, "oauth_consumer_key"

    invoke-virtual {p0, v0}, Lnet/oauth/OAuthMessage;->getParameter(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public getDump()Ljava/util/Map;
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Ljava/util/Map",
            "<",
            "Ljava/lang/String;",
            "Ljava/lang/Object;",
            ">;"
        }
    .end annotation

    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .prologue
    .line 212
    new-instance v0, Ljava/util/HashMap;

    invoke-direct {v0}, Ljava/util/HashMap;-><init>()V

    .line 213
    .local v0, into:Ljava/util/Map;,"Ljava/util/Map<Ljava/lang/String;Ljava/lang/Object;>;"
    invoke-virtual {p0, v0}, Lnet/oauth/OAuthMessage;->dump(Ljava/util/Map;)V

    .line 214
    return-object v0
.end method

.method public final getHeader(Ljava/lang/String;)Ljava/lang/String;
    .locals 4
    .parameter "name"

    .prologue
    .line 171
    const/4 v2, 0x0

    .line 172
    .local v2, value:Ljava/lang/String;
    invoke-virtual {p0}, Lnet/oauth/OAuthMessage;->getHeaders()Ljava/util/List;

    move-result-object v3

    invoke-interface {v3}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v1

    .local v1, i$:Ljava/util/Iterator;
    :cond_0
    :goto_0
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v3

    if-eqz v3, :cond_1

    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/util/Map$Entry;

    .line 173
    .local v0, header:Ljava/util/Map$Entry;,"Ljava/util/Map$Entry<Ljava/lang/String;Ljava/lang/String;>;"
    invoke-interface {v0}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Ljava/lang/String;

    invoke-virtual {p1, v3}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v3

    if-eqz v3, :cond_0

    .line 174
    invoke-interface {v0}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;

    move-result-object v2

    .end local v2           #value:Ljava/lang/String;
    check-cast v2, Ljava/lang/String;

    .restart local v2       #value:Ljava/lang/String;
    goto :goto_0

    .line 177
    .end local v0           #header:Ljava/util/Map$Entry;,"Ljava/util/Map$Entry<Ljava/lang/String;Ljava/lang/String;>;"
    :cond_1
    return-object v2
.end method

.method public final getHeaders()Ljava/util/List;
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Ljava/util/List",
            "<",
            "Ljava/util/Map$Entry",
            "<",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            ">;>;"
        }
    .end annotation

    .prologue
    .line 182
    iget-object v0, p0, Lnet/oauth/OAuthMessage;->headers:Ljava/util/List;

    return-object v0
.end method

.method public getParameter(Ljava/lang/String;)Ljava/lang/String;
    .locals 1
    .parameter "name"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .prologue
    .line 117
    invoke-virtual {p0}, Lnet/oauth/OAuthMessage;->getParameterMap()Ljava/util/Map;

    move-result-object v0

    invoke-interface {v0, p1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/String;

    return-object v0
.end method

.method protected getParameterMap()Ljava/util/Map;
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Ljava/util/Map",
            "<",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            ">;"
        }
    .end annotation

    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .prologue
    .line 137
    invoke-direct {p0}, Lnet/oauth/OAuthMessage;->beforeGetParameter()V

    .line 138
    iget-object v0, p0, Lnet/oauth/OAuthMessage;->parameterMap:Ljava/util/Map;

    if-nez v0, :cond_0

    .line 139
    iget-object v0, p0, Lnet/oauth/OAuthMessage;->parameters:Ljava/util/List;

    invoke-static {v0}, Lnet/oauth/OAuth;->newMap(Ljava/lang/Iterable;)Ljava/util/Map;

    move-result-object v0

    iput-object v0, p0, Lnet/oauth/OAuthMessage;->parameterMap:Ljava/util/Map;

    .line 141
    :cond_0
    iget-object v0, p0, Lnet/oauth/OAuthMessage;->parameterMap:Ljava/util/Map;

    return-object v0
.end method

.method public getParameters()Ljava/util/List;
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Ljava/util/List",
            "<",
            "Ljava/util/Map$Entry",
            "<",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            ">;>;"
        }
    .end annotation

    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .prologue
    .line 97
    invoke-direct {p0}, Lnet/oauth/OAuthMessage;->beforeGetParameter()V

    .line 98
    iget-object v0, p0, Lnet/oauth/OAuthMessage;->parameters:Ljava/util/List;

    invoke-static {v0}, Ljava/util/Collections;->unmodifiableList(Ljava/util/List;)Ljava/util/List;

    move-result-object v0

    return-object v0
.end method

.method public getSignature()Ljava/lang/String;
    .locals 1
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .prologue
    .line 133
    const-string v0, "oauth_signature"

    invoke-virtual {p0, v0}, Lnet/oauth/OAuthMessage;->getParameter(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public getSignatureMethod()Ljava/lang/String;
    .locals 1
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .prologue
    .line 129
    const-string v0, "oauth_signature_method"

    invoke-virtual {p0, v0}, Lnet/oauth/OAuthMessage;->getParameter(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public getToken()Ljava/lang/String;
    .locals 1
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .prologue
    .line 125
    const-string v0, "oauth_token"

    invoke-virtual {p0, v0}, Lnet/oauth/OAuthMessage;->getParameter(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public final readBodyAsString()Ljava/lang/String;
    .locals 2
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .prologue
    .line 193
    invoke-virtual {p0}, Lnet/oauth/OAuthMessage;->getBodyAsStream()Ljava/io/InputStream;

    move-result-object v0

    .line 194
    .local v0, body:Ljava/io/InputStream;
    invoke-virtual {p0}, Lnet/oauth/OAuthMessage;->getBodyEncoding()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Lnet/oauth/OAuthMessage;->readAll(Ljava/io/InputStream;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    return-object v1
.end method

.method public varargs requireParameters([Ljava/lang/String;)V
    .locals 9
    .parameter "names"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lnet/oauth/OAuthProblemException;,
            Ljava/io/IOException;
        }
    .end annotation

    .prologue
    .line 237
    invoke-virtual {p0}, Lnet/oauth/OAuthMessage;->getParameterMap()Ljava/util/Map;

    move-result-object v7

    invoke-interface {v7}, Ljava/util/Map;->keySet()Ljava/util/Set;

    move-result-object v4

    .line 238
    .local v4, present:Ljava/util/Set;,"Ljava/util/Set<Ljava/lang/String;>;"
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    .line 239
    .local v0, absent:Ljava/util/List;,"Ljava/util/List<Ljava/lang/String;>;"
    move-object v1, p1

    .local v1, arr$:[Ljava/lang/String;
    array-length v3, v1

    .local v3, len$:I
    const/4 v2, 0x0

    .local v2, i$:I
    :goto_0
    if-ge v2, v3, :cond_1

    aget-object v6, v1, v2

    .line 240
    .local v6, required:Ljava/lang/String;
    invoke-interface {v4, v6}, Ljava/util/Set;->contains(Ljava/lang/Object;)Z

    move-result v7

    if-nez v7, :cond_0

    .line 241
    invoke-interface {v0, v6}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 239
    :cond_0
    add-int/lit8 v2, v2, 0x1

    goto :goto_0

    .line 244
    .end local v6           #required:Ljava/lang/String;
    :cond_1
    invoke-interface {v0}, Ljava/util/List;->isEmpty()Z

    move-result v7

    if-nez v7, :cond_2

    .line 245
    new-instance v5, Lnet/oauth/OAuthProblemException;

    const-string v7, "parameter_absent"

    invoke-direct {v5, v7}, Lnet/oauth/OAuthProblemException;-><init>(Ljava/lang/String;)V

    .line 246
    .local v5, problem:Lnet/oauth/OAuthProblemException;
    const-string v7, "oauth_parameters_absent"

    invoke-static {v0}, Lnet/oauth/OAuth;->percentEncode(Ljava/lang/Iterable;)Ljava/lang/String;

    move-result-object v8

    invoke-virtual {v5, v7, v8}, Lnet/oauth/OAuthProblemException;->setParameter(Ljava/lang/String;Ljava/lang/Object;)V

    .line 247
    throw v5

    .line 249
    .end local v5           #problem:Lnet/oauth/OAuthProblemException;
    :cond_2
    return-void
.end method

.method public sign(Lnet/oauth/OAuthAccessor;)V
    .locals 1
    .parameter "accessor"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;,
            Lnet/oauth/OAuthException;,
            Ljava/net/URISyntaxException;
        }
    .end annotation

    .prologue
    .line 295
    invoke-static {p0, p1}, Lnet/oauth/signature/OAuthSignatureMethod;->newSigner(Lnet/oauth/OAuthMessage;Lnet/oauth/OAuthAccessor;)Lnet/oauth/signature/OAuthSignatureMethod;

    move-result-object v0

    invoke-virtual {v0, p0}, Lnet/oauth/signature/OAuthSignatureMethod;->sign(Lnet/oauth/OAuthMessage;)V

    .line 296
    return-void
.end method

.method public toString()Ljava/lang/String;
    .locals 2

    .prologue
    .line 78
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    const-string v1, "OAuthMessage("

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget-object v1, p0, Lnet/oauth/OAuthMessage;->method:Ljava/lang/String;

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, ", "

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget-object v1, p0, Lnet/oauth/OAuthMessage;->URL:Ljava/lang/String;

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, ", "

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget-object v1, p0, Lnet/oauth/OAuthMessage;->parameters:Ljava/util/List;

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, ")"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method
